import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Task {

    public static void main(String[] args) throws UnsupportedEncodingException {
        byte[] bytes = encoding("v我50", "UTF-8");
        System.out.println(Arrays.toString(bytes));
        System.out.println(decoding(bytes, "UTF-8"));

        byte[] bytes1 = encoding("a加b", "GBK");
        System.out.println(Arrays.toString(bytes1));
        System.out.println(decoding(bytes1, "GBK"));
    }

    private static String decoding(byte[] bytes, String charsetName) throws UnsupportedEncodingException {
        /* TODO 字节数组的解码 */;
    }

    public static byte[] encoding(String content, String charsetName) throws UnsupportedEncodingException {
        /* TODO 字符串的编码 */
    }

}